import json

from django.conf import settings
from ronglian_sms_sdk import SmsSDK

accId = '容联云通讯分配的主账号ID'
accToken = '容联云通讯分配的主账号TOKEN'
appId = '容联云通讯分配的应用ID'

def send_sms(tid, mobile, datas):
    ronglianyun = settings.RONGLIANYUN
    sdk = SmsSDK(ronglianyun.get('accId'), ronglianyun.get('accToken'), ronglianyun.get('appId'))
    resp = sdk.sendMessage(tid, mobile, datas)
    response = json.loads(resp)
    print(response,print(response))
    return response.get('statusCode') == '000000'